<template>
  <el-progress :style="{
    width: proxy.$size(width, '100%'),
  }" :percentage="keyword" v-bind="{
    'text-inside': true,
    'stroke-width': 16,
    ...$attrs,
    disabled: typeof $attrs.disabled === 'function' ? $attrs.disabled(data) : $attrs.disabled
  }" />
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
//获取父级数据
const props = withDefaults(
  defineProps<{
    data: any;
    dataName?: any;
    width?: string | number;
    searchBtn?: Function;
    addBtn?: Function;
  }>(),
  {

  },
);
const keyword = computed({
  get() {
    return props.dataName ? props.data[props.dataName] : props.data;
  },
  set(val) {
    if (props.dataName) {
      props.data[props.dataName] = val
    } else {
      props.data = val;
    }
  },
});

onMounted(() => {

});
</script>
<style scoped></style>
